home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / loadstr.doc < prev    next >
Text File  |  1987-04-01  |  1KB  |  41 lines

  1.  
  2.  
  3.  
  4.         NAME
  5.                 loadstr -- load a string with padding
  6.  
  7.         SYNOPSIS
  8.                 void loadstr(dest, source, qty);
  9.                 char *dest;       string destination
  10.                 char *source;     source string (NULL terminated)
  11.                 int qty;          bytes to place in destination
  12.  
  13.  
  14.         DESCRIPTION
  15.         This function is similar to strcat() in that it copies
  16.         a source string to a destination string.  However,
  17.         if the source string is smaller than "qty", the destination
  18.         will be padded to the "qty" parameter with spaces.  In
  19.         addition, the destination string will NOT be terminated
  20.         by a NULL.  This is an unusual method of operation, but
  21.         handy in some cases.
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.         EXAMPLE
  29.            char title[] = "This is a title";
  30.            char buffer[128];
  31.  
  32.            loadstr(buffer, title, 80);
  33.            buffer[80] = NULL;         /* add terminator */
  34.            puts(buffer);       /* message will be 80 characters long,
  35.                                ** left justified */
  36.  
  37.  
  38.  
  39.  
  40.         This function is found in SMDLx.LIB for the Datalight Compiler
  41.